#include "InGlobal.h"
#include<iostream>
#include<string>

using namespace std;

InGlobal::InGlobal(Scope *pParentScope)
{
    m_eType = Scope::eScopeGlobal;
    m_pxParent = pParentScope;
}

InGlobal::~InGlobal(void)
{
}

Scope* InGlobal::process(Token& inToken, bool &bIsEndOfScope)
{
    Scope* pxScope = NULL;
    bIsEndOfScope=false;

    pxScope = Scope::process(inToken, bIsEndOfScope);

    if(pxScope)
    {
        if(Scope::eScopeBlock == pxScope->m_eType)
        //A block scope within global is considered as function
        //FIXME Not considering structs etc FTB
        {
            this->m_iSubstreamElement++;
            this->m_asSubstream.push_back("");
        }
    }

    return pxScope;
}
